function [fitresult, gof] = fit_plognpdf(z, f)
%fit_plognpdf(Z,F)
%  Create a fit.
%
%  Data for 'fit_plognpdf' fit:
%      X Input : z
%      Y Output: f
%  Output:
%      fitresult : a fit object representing the fit.
%      gof : structure with goodness-of fit info.
%
%  See also FIT, CFIT, SFIT.

%  Auto-generated by MATLAB on 22-May-2019 11:49:32


%% Fit: 'fit_plognpdf'.
[xData, yData] = prepareCurveData( z, f );

% Set up fittype and options.
ft = fittype( 'plognpdf(x,alpha,mu,sigma)', 'independent', 'x', 'dependent', 'y' );
opts = fitoptions( 'Method', 'NonlinearLeastSquares' );
opts.Display = 'Off';
opts.StartPoint = [2 0.655740699156587 0.757740130578333];

% Fit model to data.
[fitresult, gof] = fit( xData, yData, ft, opts );

% % Plot fit with data.
% figure( 'Name', 'fit_plognpdf' );
% h = plot( fitresult, xData, yData );
% legend( h, 'f vs. z', 'fit_plognpdf', 'Location', 'NorthEast', 'Interpreter', 'none' );
% % Label axes
% xlabel( 'z', 'Interpreter', 'none' );
% ylabel( 'f', 'Interpreter', 'none' );
% grid on


